package com.atguigu.javase.bank;

public class CheckingAccount extends Account{
	private double overdreftProtection;

	public CheckingAccount(double balance) {
		super(balance);
	}

	@Override
	public boolean withdraw(double amt) {
		if(balance >= amt) {
			balance -= amt;
		}else {
			if(overdreftProtection >= amt - balance) {
				overdreftProtection -= (amt - balance);
				balance = 0;
			}else {
				return false;
			}
		}
		return true;
	}
}
